package com.firesrc.mail.search;

import java.io.IOException;
import java.util.HashSet;
import java.util.Set;

import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;

public class SearchMailHicChinaImpl extends AbstractSearchMail {

	@Override
	public Set getMailListFromUrl(String url) {
		try {
			if (url.startsWith("www.")) {
				url = url.substring(4);
			}
			Document doc = Jsoup
					.connect(
							"http://whois.hichina.com//whois/api_whois_full?host=" + url
									+ "&web_server=whois.paycenter.com.cn").userAgent("FireFox 4.0") // ����User-Agent
					.cookie("auth", "token") // ����cookie
					.timeout(10000) // �������ӳ�ʱʱ��
					.get();
			return getMailListFromText(doc.text());
		} catch (IOException e) {
			// TODO Auto-generated catch block
			System.out.println("HicChain查询网站出错:" + url);
		}
		return new HashSet<String>();
	}

}
